#ifndef STRATUM_OBJECT_H
#define STRATUM_OBJECT_H
#include <cstdio>
#include "utils.h"

class StratumObject {
public:
    int m_id;
    int m_lock_count;
    bool m_unlock;
    bool m_deleted;
};

typedef void (*StratumObjectDeleteFunc)(StratumObject*);

StratumObject* objectFind(CommonList* list, int id, bool lock=false);

// 剪枝
void objectPrune(CommonList* list, StratumObjectDeleteFunc deleteFunc);

// 加锁
void objectLock(StratumObject* obj);

// 解锁
void objectUnlock(StratumObject* obj);

// 删除
void objectDelete(StratumObject* obj);

#endif //STRATUM_OBJECT_H
